using ProtoModels;

public class PlayerStatsManager
{
	public enum SkillType
	{
		Attack = 0,
		Defence = 1,
		Racket = 2,
		Speed = 3,
		Topspin = 4,
		Backspin = 5,
		Serve = 6
	}

	public enum AttributeType
	{
		None = 0,
		Strength = 1,
		Speed = 2,
		Popularity = 3
	}

	public delegate void OnSave();

	public PlayerStats playerStats { get; protected set; }

	public PlayerTraining playerTraining { get; protected set; }

	public PlayerMood playerMood { get; protected set; }

	public PlayerStatsManager()
	{
	}

	public PlayerStatsManager(PlayerModel model, OnSave onSave)
	{
		playerStats = new PlayerStats(model, onSave.Invoke, SkillConfig.OriginalPlayerConfig());
		playerMood = new PlayerMood(model, onSave.Invoke);
		playerTraining = new PlayerTraining(model, onSave.Invoke, playerStats);
		if (model.activeTraining != null && model.activeTraining.Count != 0)
		{
			playerTraining.AddTrainingToScheduler();
		}
	}

	public static string DescriptionForSkillType(SkillType type)
	{
		switch (type)
		{
		case SkillType.Attack:
			return "Attack Skill - harder for your opponent to return your ball!";
		case SkillType.Defence:
			return "Defense Skill - easier for you to return the opponents ball!";
		default:
			return string.Empty;
		}
	}

	public virtual void ReloadModel(PlayerModel model)
	{
		playerStats.ReloadModel(model);
		playerMood.ReloadModel(model);
		playerTraining.ReloadModel(model);
	}
}
